﻿using System;
using System.Configuration;
using Whois.API;

namespace WWW
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void CheckDomain(object sender, EventArgs e)
        {
            var service = new XmlService(ConfigurationManager.AppSettings["username"],
                                         ConfigurationManager.AppSettings["password"],
                                         ConfigurationManager.AppSettings["urlformat"]);

            var result = service.GetResponse(Domain.Text);
            if(result==null) return;

            DomainName.Text = result.DomainName;
            DomainExpires.Text = result.RegistryData.ExpiresDate.ToString();
        }
    }
}
